home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presentation Library 1993 Winter / The Apple Reference & Presentations Library CD Winter 93 - Partner Edition.7z / Image.iso / Applications / Graphics / PowerDraw™ 3.0 Demo / Header < prev    next >
Text File  |  1990-03-19  |  15KB  |  377 lines

  1. Const
  2.     { cursor ID numbers }
  3.     fingerCursor    = 104;
  4.     iBeamCursor        = 101;
  5.     crossCursor        = 2;
  6.     watchCursor        = 4;
  7.     targetCursor    = 261;
  8.     lassoCursor        = 108;
  9.     zoomInCursor    = 109;
  10.     zoomOutCursor    = 110;
  11.  
  12.     { font numbers }
  13.     systemFont= 0;
  14.     applFont    = 1;
  15.     newYork        = 2;
  16.     geneva        = 3;
  17.     monaco        = 4;
  18.     venice        = 5;
  19.     london        = 6;
  20.     athens        = 7;
  21.     sanFran        = 8;
  22.     toronto        = 9;
  23.     cairo            = 11;
  24.     losAngeles= 12;
  25.     times            = 20;
  26.     helvetica    = 21;
  27.     courier        = 22;
  28.     symbol        = 23;
  29.     mobile        = 24;
  30.  
  31.     { justification equates }
  32.     justLeft    = 0;
  33.     justRight    =-1;
  34.     justCenter= 1;
  35.  
  36.     { pattern numbers }
  37.     nonePat        = 1;
  38.     whitePat    = 2;
  39.     blackPat    = 3;
  40.     dkGrayPat    = 4;
  41.     grayPat        = 6;
  42.     ltGrayPat    = 9;
  43.     
  44.     { event code equates }
  45.     nullEvent    = 0;
  46.     mouseDown    = 1;
  47.     mouseUp        = 2;
  48.     keyDown        = 3;
  49.     keyUp            = 4;
  50.     
  51.     { event mask equates }
  52.     mDownMask        = 2;
  53.     mUpMask            = 4;
  54.     keyDownMask    = 8;
  55.     keyUpMask        = 16;
  56.     
  57.     { arrow mask equates }
  58.     noArrowMask    = 0;
  59.     arrow1Mask    = 1;
  60.     arrow2Mask    = 2;
  61.     arrowMask        = 4;
  62.     circleMask    = 8;
  63.     slashMask        = 16;
  64.  
  65.     { object type IDs }
  66.     emptyObj        = -1;
  67.     nullobj            = 0;
  68.     textobj            = 1;
  69.     lineobj            = 2;
  70.     dimLineObj    = 3;
  71.     rectobj            = 4;
  72.     rtRectObj        = 5;
  73.     rrectobj        = 6;
  74.     rtArcObj        = 7;
  75.     arcobj            = 8;
  76.     ovalobj            = 9;
  77.     rOvalobj        = 10;
  78.     polyobj            = 11;
  79.     smoothobj        = 12;
  80.     rgnObj            = 13;
  81.     bitsObj            = 14;
  82.     userObj            = 15;
  83.     grpObj            = 16;
  84.     regPolyObj    = 18;
  85.     pointObj        = 19;
  86.     bezObj            = 20;
  87.     dimArcObj        = 21;
  88.     rtRRectObj    = 22;
  89.     vectorObj        = 23;
  90.     
  91.     { angle units }
  92.     cartesian        = 1;
  93.     azimuth            = 2;
  94.     bearing            = 3;
  95.     gradients        = 4;
  96.     
  97.     { angle accuracy }
  98.     noDec                = 1;
  99.     oneDec            = 2;
  100.     twoDec            = 3;
  101.     threeDec        = 4;
  102.     fourDec            = 5;
  103.     degMin            = 6;
  104.     degMinSec        = 7;
  105.     
  106.     { fractional units - negative value means no unit appended }
  107.     inches            = 1;
  108.     feetNInches    = 2;
  109.     noUnit            = 3;
  110.     
  111.     { fractional accuracy }
  112.     { 1/2        = 1;}
  113.     { 1/4        = 2;}
  114.     { 1/8        = 3;}
  115.     { 1/16    = 4;}
  116.     { 1/32    = 5;}
  117.     { 1/64    = 6;}
  118.     { 1/128    = 7;}
  119.     { 1/256    = 8;}
  120.     { 1/512    = 9;}
  121.     
  122.     { decimal units - negative value means no unit appended }
  123.     DecInches        = 1;
  124.     DecFeet            = 2;
  125.     DecMiles        = 3;
  126.     noUnitInch    = 4;
  127.     DecMm                = 5;
  128.     DecCm                = 6;
  129.     DecM                = 7;
  130.     DecKm                = 8;
  131.     noUnitMetric= 9;
  132.     
  133. Type
  134.     String        = Array[1..64] OF Char;
  135.     FString        = Array[1..32] OF Char;
  136.     ObjectPtr    = Integer;
  137.     ListPtr        =    Integer;
  138.  
  139.     RPoint=Record
  140.         h,v : Real;
  141.     End;
  142.  
  143.     DialogPtr            =    ^Integer;
  144.     
  145.     UnitRec       = Record
  146.                                         fractions     : Boolean;
  147.                                         numDigits     : Integer;
  148.                                         fracAccuracy  : Integer;
  149.                                         fractionalType: Integer;
  150.                                         decimalType   : Integer;
  151.                                         scale         : Real;
  152.                                     End;
  153.     
  154.     AngleUnitRec  = Record
  155.                                         angleUnits    : Integer;
  156.                                         angleAccuracy : Integer;
  157.                                         refAngle      : Real;
  158.                                     End;
  159.                                     
  160.     ObjAttRecord  = Record
  161.                                         pPat    : Integer;
  162.                                         fPat    : Integer;
  163.                                         pSize   : Integer;
  164.                                         pColor  : Integer;
  165.                                         fColor  : Integer;
  166.                                         arrow   : Integer;
  167.                                         CASE WhatObject:Integer OF
  168.                                             nullObj        : ();
  169.                                             textobj        : ();
  170.                                             dimLineObj,
  171.                                             lineobj        : (lPt1,lPt2:RPoint);
  172.                                             rectobj        : (rectPt1,rectPt2:RPoint);
  173.                                             rrectobj    : (rrectPt1,rrectPt2:RPoint; ovalrad:Real);
  174.                                             arcobj    : (arectPt1,arectPt2:RPoint;startangle,arcangle:Real);
  175.                                             ovalobj   : (orectPt1,orectPt2:RPoint);
  176.                                             rtArcObj,
  177.                                             rtRectObj,
  178.                                             rOvalObj  : (rtRectPt1,rtRectPt2:RPoint;stAngle,aAngle:Real;rotAngle: Real);
  179.                                             bezObj,                       
  180.                                             polyobj,
  181.                                             smoothobj : (numPts : Integer);
  182.                                             pointObj  : (pt: RPoint);
  183.                                             bitsObj   : (btsRectPt1,btsRectPt2:RPoint);
  184.                                             grpObj    : (groupList: ListPtr);
  185.                                             userObj        :    (locPt,scale:RPoint; rotation:Real; symID    : Integer;symbolList: ListPtr);
  186.                                             regPolyObj: ();
  187.         End;
  188.   AttrRecord    = Record
  189.                                         pPat    : Integer;
  190.                                         fPat    : Integer;
  191.                                         pSize   : Integer;
  192.                                         pColor  : Integer;
  193.                                         fColor  : Integer;
  194.                                         arrow   : Integer;
  195.                                     End;
  196.                   
  197. Procedure PutFile(Var good: Boolean; Var vRefNum: Integer; Var fName:FString); Begin pdstd(-98);End;
  198. Procedure GetFile(Var good: Boolean; Var vRefNum: Integer; Var fName:FString); Begin pdstd(-99);End;
  199.  
  200. Procedure GotoXY(x,y: Integer); Begin pdstd(-100);End;
  201. Procedure TextWindow(show: Boolean);Begin pdstd(-101);End;
  202. Procedure ClearTextWindow;Begin pdstd(-102);End;
  203.  
  204. Function ValidWindow:Boolean;Begin pdstd(-1);End;
  205. Procedure ReDraw;Begin pdstd(0);End;
  206.  
  207. Procedure GetLayerAttr(layerNum:Integer;Var visible, dimmed, transparent : Boolean);Begin pdstd(1);End;
  208. Procedure SetLayerAttr(layerNum:Integer; visible, dimmed, transparent : Boolean);Begin pdstd(2);End;
  209.  
  210. Function AddText(s: String; font,size,justify: Integer; locX,locY:Real):ObjectPtr;Begin pdstd(3);End;
  211. Function AddPoint(x1,y1: Real):ObjectPtr;Begin pdstd(4);End;
  212. Function AddLine(x1,y1,x2,y2: Real):ObjectPtr;Begin pdstd(5);End;
  213. Function AddDimLine(x1,y1,x2,y2: Real):ObjectPtr;Begin pdstd(10);End;
  214. Function AddRect(x1,y1,x2,y2: Real):ObjectPtr;Begin pdstd(6);End;
  215. Function AddRRect(x1,y1,x2,y2: Real; rad: Real):ObjectPtr;Begin pdstd(7);End;
  216. Function AddOval(x1,y1,x2,y2: Real):ObjectPtr;Begin pdstd(8);End;
  217. Function AddArc(x1,y1,x2,y2: Real; startAngle,argAngle: Real):ObjectPtr;Begin pdstd(9);End;
  218. Function AddPoly(x,y: Real): ObjectPtr;Begin pdstd(11);End;
  219. Function AddSmooth(x,y: Real): ObjectPtr;Begin pdstd(12);End;
  220. Function AddBezier(x,y: Real): ObjectPtr;Begin pdstd(13);End;
  221.  
  222. Procedure GhostPoint(x1,y1: Real);Begin pdstd(30);End;
  223. Procedure GhostLine(x1,y1,x2,y2: Real);Begin pdstd(31);End;
  224. Procedure GhostDimLine(x1,y1,x2,y2: Real);Begin pdstd(32);End;
  225. Procedure GhostRect(x1,y1,x2,y2: Real);Begin pdstd(33);End;
  226. Procedure GhostRRect(x1,y1,x2,y2: Real; rad: Real);Begin pdstd(34);End;
  227. Procedure GhostOval(x1,y1,x2,y2: Real);Begin pdstd(35);End;
  228. Procedure GhostArc(x1,y1,x2,y2: Real; startAngle,argAngle: Real);Begin pdstd(36);End;
  229.  
  230. Procedure SelectAll;Begin pdstd(50);End;
  231. Procedure DeselectAll;Begin pdstd(51);End;
  232. Procedure SelectRect(x,y,x1,y1:Real);Begin pdstd(52);End;
  233. Procedure ClearSelection;Begin pdstd(60);End;
  234. Function  CountSelection:Integer;Begin pdStd(402);end;
  235. Procedure GetSelectionRect(Var x,y,x1,y1:Real);Begin pdStd(403);end;
  236.  
  237. Procedure SetCurrentLayer(theLayer: Integer);Begin pdstd(70);End;
  238. Function  NumLayers: Integer;Begin pdstd(71);End;
  239. Function  CurrentLayer: Integer;Begin pdstd(72);End;
  240. Procedure GetLayerName(layerNum: Integer;Var name: String);Begin PDStd(106); End;
  241. Procedure SetLayerName(layerNum: Integer; name: String);Begin PDStd(107); End;
  242. Procedure AddLayer(lName: String);Begin pdstd(102);End;
  243.  
  244. Function  Button:Boolean;Begin pdstd(97);End;
  245. Procedure Mouse(Var x,y: Real);Begin pdstd(98);End;
  246. Procedure Tone(frequency,duration,volume: Integer);Begin pdstd(99);End;
  247. Procedure Wait(i: Integer);Begin pdstd(100);End;
  248. Function  Random: Integer;Begin pdstd(101);End;
  249. Function  GetEvent(evtMask: Integer;Var x,y: Real;Var message,time,what: Integer):Boolean;Begin pdstd(105);End;
  250. Procedure ScrollMouse;Begin pdstd(200);End;
  251.  
  252. Procedure SetAttr(pPat,fPat,pSize,pColor,fColor,arrow: Integer);Begin pdstd(103);End;
  253. Procedure GetAttr(Var pPat,fPat,pSize,pColor,fColor,arrow: Integer);Begin pdstd(104);End;
  254.  
  255. Function  Tan(x: Real):Real;Begin pdstd(300);End;
  256. Function  ArcSin(x: Real):Real;Begin pdstd(301);End;
  257. Function  ArcCos(x: Real):Real;Begin pdstd(302);End;
  258. Function  Distance(x,y,x1,y1: Real):Real;Begin pdStd(303);end;
  259. Procedure RotateCoordinate(Var x,y: Real; angle: Real);Begin pdStd(304);end;
  260. Procedure Intersection(x,y,x1,y1,x2,y2,x3,y3: Real; Var ix,iy: Real);Begin pdStd(305);end;
  261.  
  262. Procedure SetObjAttr(theObject: ObjectPtr; Var attr: ObjAttRecord);Begin pdStd(246);end;
  263. Procedure GetObjAttr(theObject: ObjectPtr; Var attr: ObjAttRecord);Begin pdStd(247);end;
  264. Procedure SetBaseAttr(theObject: ObjectPtr; attr: AttrRecord);Begin pdStd(248);end;
  265. Procedure GetBaseAttr(theObject: ObjectPtr; Var attr: AttrRecord);Begin pdStd(249);end;
  266. Procedure GetSymbolName(symbolID: Integer; Var s: String);Begin pdStd(245);end;
  267. Procedure GetGroupName(objectIndex: Integer; Var s: String);Begin pdStd(244);end;
  268. Procedure SetGroupName(objectIndex: Integer; s: String);Begin pdStd(243);end;
  269.  
  270. Function PickObject(x,y: Real; Var theObject: ObjectPtr) : Boolean;Begin pdStd(250);end;
  271. Procedure SelectObject(theObject: ObjectPtr; select: Boolean);Begin pdStd(252);end;
  272. Function ItemSelected(theObject: ObjectPtr): Boolean;Begin pdStd(253);End;
  273.  
  274. Function NextObject(theObject: ObjectPtr) : ObjectPtr;Begin pdStd(255);end;
  275. Function PrevObject(theObject: ObjectPtr) : ObjectPtr;Begin pdStd(256);end;
  276. Function ValidObject(theObject: ObjectPtr) : Boolean;Begin pdStd(257);end;
  277. Function LastObjIndex : ObjectPtr;Begin pdStd(266);end;
  278.  
  279. Procedure DoCommand(command: Integer);Begin pdStd(282); End;
  280. Procedure DoMenu(theMenu,theItem: Integer; option,command: Boolean);Begin pdStd(258);end;
  281.  
  282. Procedure DuplicateArray(nRows,nCols: Integer; dx,dy: Real);Begin pdStd(259);end;
  283. Procedure DuplicateCArray(angle: Real; num: Integer; absolute,rotItem:Boolean; cX,cY: Real);Begin pdStd(260);end;
  284. Procedure ClearObject(theObject: ObjectPtr);Begin pdStd(261);end;
  285. Function  CloneObject(theObject: ObjectPtr): ObjectPtr;Begin pdStd(267);end;
  286.  
  287. Procedure MoveSelection(dx,dy: Real);Begin pdStd(262);end;
  288. Procedure ScaleSelection(xScale,vScale: Real; scalePtX,scalePtY: Real);Begin pdStd(263);end;
  289. Procedure RotateSelection(angle: Real; aboutPt: Boolean; rotPtX,rotPtY:Real);Begin pdStd(264);end;
  290. Procedure MirrorSelection(x,y,x1,y1: Real; dupItems: Boolean);Begin pdStd(265);end;
  291.  
  292. Procedure MoveObject(theObject: ObjectPtr; dx,dy: Real);Begin pdStd(270);end;
  293. Procedure ScaleObject(theObject: ObjectPtr; xScale,yScale:Real; aboutCenter: Boolean; x,y: Real);Begin pdStd(271);end;
  294. Procedure RotateObject(theObject: ObjectPtr; angle: Real;rotPtX,rotPtY: Real);Begin pdStd(272);end;
  295. Procedure MirrorObject(theObject: ObjectPtr; x,y,x1,y1: Real; dupItem: Boolean);Begin pdStd(273);end;
  296.  
  297. Procedure Alert(s: String);  Begin pdStd(280);end;
  298. Function  Confirm(s: String): Boolean;Begin pdStd(281);end;
  299. Function  Request(Var reply: String; prompt: String):Boolean;Begin pdStd(283);end;
  300. Procedure GetDate(Var day,month,year: Integer);Begin pdStd(400);end;
  301. Procedure GetTime(Var hour,minute,second: Integer);Begin pdStd(401);end;
  302.  
  303.  
  304. Procedure DrawPicture(i: Integer; l,t,b,r:Real);Begin pdStd(-300);end;
  305. Procedure SetCursor(cursorID: Integer);Begin pdStd(-299);end;
  306. Function  FreeMemory:Integer;Begin pdStd(-298);end;
  307.  
  308. Procedure UnitToStr(unit: Real; Var s : String);Begin pdStd(306);end;
  309. Function  StrToUnit(s : String):Real;Begin pdStd(307);end;
  310. Procedure AngleToStr(absolute: Boolean; x: Real;Var s : String);Begin pdStd(308);end;
  311. Function  StrToAngle(absolute: Boolean; s : String):Real;Begin pdStd(309);end;
  312. Procedure NumToStr(x: Real; numDigits:Integer; Var s : String);Begin pdStd(310);end;
  313. Function  StrToNum(s : String):Real;Begin pdStd(311);end;
  314.  
  315. Procedure GetPolyPt(index:Integer; theObject: ObjectPtr;Var x,y: Real);Begin pdStd(312);end;
  316. Procedure SetPolyPt(index:Integer; theObject: ObjectPtr; x,y: Real);Begin pdStd(313);end;
  317.  
  318. Procedure ClearEvents;Begin pdStd(314);end;
  319.  
  320. Procedure SetGridSnap(snapOn: Boolean);Begin pdStd(350); End;
  321. Function  GridSnapOn: Boolean;Begin pdStd(351); End;
  322. Procedure SetObjectSnap(on: Boolean);Begin pdStd(352); End;
  323. Function  ObjectSnapOn: Boolean;Begin pdStd(353); End;
  324. Function  GetCurrentZoom: Real;Begin pdStd(354); End;
  325.  
  326. Procedure PDUnits(Var frac: Boolean;Var numDig,fAcc,fType,dType  : Integer;Var scale: Real; setIt: Boolean); Begin PDStd(355);End;
  327. Procedure PDAngleUnits(Var angleUnits,angleAccuracy : Integer;Var refAngle: Real; setIt: Boolean);Begin PDStd(356);End;
  328.  
  329. Procedure GetAngleUnits(Var angleUnits:AngleUnitRec); Begin With angleUnits DO PDAngleUnits(angleUnits,angleAccuracy,refAngle,False); End;
  330. Procedure SetAngleUnits(angleUnits:AngleUnitRec);Begin With angleUnits DO PDAngleUnits(angleUnits,angleAccuracy,refAngle,True);End;
  331. Procedure GetUnits(Var units:UnitRec);Begin With units DO PDUnits(fractions,numDigits,fracAccuracy,fractionalType,decimalType,scale,false);End;
  332. Procedure SetUnits(units:UnitRec);Begin With units DO PDUnits(fractions,numDigits,fracAccuracy,fractionalType,decimalType,scale,true);End;
  333.  
  334. Function  Length(theStr:String):Integer;Begin pdStd(315); End;
  335. Procedure Delete(Var s:String;stPos,len:Integer);Begin pdStd(316); End;
  336. Procedure Copy(Var s,newStr:String;stPos,len:Integer);Begin pdStd(317); End;
  337. Function  Pos(ch:Char;theStr:String):Integer;Begin pdStd(318); End;
  338.  
  339. Function  LastWindow: Integer;Begin pdStd(320); End;
  340. Procedure SelectWindow(windowNum: Integer);Begin pdStd(321); End;
  341. Procedure GetWindowName(windowNum: Integer; Var name: String);Begin pdStd(322); End;
  342.  
  343. Procedure GetCurrentList(Var list: ListPtr);Begin pdStd(360);End;
  344. Procedure SetCurrentList(list: ListPtr);Begin pdStd(361);End;
  345. Procedure CompactList(list: ListPtr);Begin pdStd(362);End;
  346. Procedure ClearUndo;Begin pdStd(363);End;
  347.  
  348. Procedure SetTextDefault(font,size: Integer);Begin pdStd(365);End;
  349. Procedure GetTextDefault(Var font,size: Integer);Begin pdStd(366);End;
  350. Function  StringMetrics(s: String; Var ascent,descent,leading:Integer): Integer;Begin pdStd(367);End;
  351.  
  352. Function  GetDialog(dialogID: Integer):DialogPtr;Begin pdStd(370);End;
  353. Procedure DisposeDialog(theDialog: DialogPtr);Begin pdStd(371);End;
  354. Procedure ModalDialog(Var itemHit: Integer);Begin pdStd(372);End;
  355.  
  356. Function  GetCtlValue(theDialog:DialogPtr; theItem:Integer):Integer;Begin pdStd(373);End;
  357. Procedure SetCtlValue(theDialog:DialogPtr; theItem:Integer; value:Integer);Begin pdStd(374);End;
  358. Procedure GetText(theDialog:DialogPtr; theItem:Integer;Var theText:String);Begin pdStd(375);End;
  359. Procedure SetText(theDialog:DialogPtr; theItem:Integer; theText:String);Begin pdStd(376);End;
  360.  
  361. Function OpenDriver(fileName: String; Var refNum: Integer): Integer;Begin pdStd(120);End;
  362. Function CloseDriver(refNum: Integer): Integer;Begin pdStd(121);End;
  363.  
  364. Function SerReset(refNum: Integer; serConfig: Integer): Integer;Begin pdStd(122);End;
  365. Function SerGetBuf(refNum: Integer; Var count: Integer): Integer;Begin pdStd(127);End;
  366. Function SerHShake(refNum: Integer; fXOn,fCTS: Integer; xOn,xOff:Char): Integer;Begin pdStd(127);End;
  367.  
  368. Function FSOpen(fileName: String; vRefNum: Integer; Var refNum: Integer): Integer;Begin pdStd(123);End;
  369. Function FSClose(refNum: Integer): Integer;Begin pdStd(124);End;
  370. Function FSRead(refNum: Integer;Var count: Integer;Var s: String): Integer;Begin pdStd(125);End;
  371. Function FSWrite(refNum: Integer;Var count: Integer; s: String): Integer;Begin pdStd(126);End;
  372.  
  373. Function CountFields(theObject: Integer): Integer;                                    Begin pdStd(240);End;
  374. Procedure SetField(theObject: Integer; num: Integer; s:String);            Begin pdStd(241);End;
  375. Procedure GetField(theObject: Integer; num: Integer; Var s:String);    Begin pdStd(242);End;
  376.  
  377.